package com.rgsx.vo.entiyVo;

import com.rgsx.pojo.Order;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderVo implements Serializable {
    private String orderId;
    private String dricerId;
    private String passengerId;
    private Date beginTime;
    private Date endTime;
    private String positionStartLongitude;
    private String positionStartLatitude;
    private String positionEndLatitude;
    private String positionEndLongitude;

    public OrderVo(Order order){
        if(order != null){
            this.orderId = String.valueOf(order.getId());
            this.dricerId = String.valueOf(order.getDriverId());
            this.passengerId = String.valueOf(order.getPassengerId());
            this.beginTime = order.getBeginTime();
            this.endTime = order.getEndTime();

            this.positionStartLatitude = order.getPositionStartLatitude();
            this.positionStartLongitude = order.getPositionStartLongitude();

            this.positionEndLatitude = order.getPositionEndLatitude();
            this.positionEndLongitude = order.getPositionEndLongitude();
        }
    }
}
